package com.form;

import java.awt.EventQueue;

import javax.swing.JInternalFrame;
import javax.swing.JLabel;

import java.awt.BorderLayout;

import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.RowSorter;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableRowSorter;

public class Itemtest extends JInternalFrame {
	private JTextField txtEnen;
	private JTable table;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Itemtest frame = new Itemtest();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Itemtest() {
		setBounds(100, 100, 450, 300);
		
		JLabel lblHuhu = new JLabel("HUHU ");
		getContentPane().add(lblHuhu, BorderLayout.NORTH);
		
		txtEnen = new JTextField();
		txtEnen.setText("ENEN ");
		getContentPane().add(txtEnen, BorderLayout.WEST);
		txtEnen.setColumns(10);
		
		JScrollPane scrollPane = new JScrollPane();
		getContentPane().add(scrollPane, BorderLayout.CENTER);
		
		table = new JTable();
		/*table.setModel(new DefaultTableModel(
			new Object[][] {
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
			},
			new String[] {
				"New column", "New column", "New column", "New column", "New column"
			}
		));*/
		DefaultTableModel tableModel = new DefaultTableModel();
		RowSorter sorter = new TableRowSorter<DefaultTableModel>(tableModel);
		table.setRowSorter(sorter);
		table.setModel(tableModel);
		scrollPane.setViewportView(table);

		scrollPane.setViewportView(table);

	}

}
